<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>render函数应用</title>
</head>
<body>
<div id="app"></div>
<script src="../vue.js"></script>
<script>
    new Vue({
        el:'#app',
        data(){
            return{
                list:[1,2,3,4,5,6,7,8,9]
            }
        },
        methods:{
          dianji(){
              console.log('点击了');
          }
        },
        render:function (createElement,context) {
            return createElement(
                'div',
                {
                    class:{
                        abs:true//给div加个class
                    }
                },
                this.list.map((item)=>{
                    return createElement(
                        'button',
                        {
                            style:{fontSize:'18px',color:'red'},//给li加些样式
                            on:{click:this.dianji}
                        },
                        item
                    )
                })
            )
        }
    })
</script>
</body>
</html>